Micron Document
Fox's Git Mirrors

Node / acehoss / PyTCP.git / files / Makefile

Displaying Raw • Download

Makefile c0d45889ebbae797865487313d1e1efc691032f5 (c0d45889) Text, 1.16 KB

PYTHON_VERSION := 3.10
VENV := venv
PY_PATH := $(shell find pytcp -name '*.py')
TEST_PATH := $(shell find tests -name '*.py')

all: venv

$(VENV)/bin/activate: requirements.txt
@apt-get install -y python3-venv
@python$(PYTHON_VERSION) -m venv $(VENV)
@./$(VENV)/bin/pip install -r requirements.txt

venv: $(VENV)/bin/activate

run: venv
@./$(VENV)/bin/python3 pytcp/pytcp.py

clean:
@rm -rf $(VENV)
@find . -type d -name '__pycache__' -exec rm -rf {} +

lint: venv
@echo '<<< CODESPELL'
@./$(VENV)/bin/codespell -w --ignore-words-list="ect,ether,nd,tha" --quiet-level=2 ${PY_PATH} ${TEST_PATH} README.md
@echo '<<< ISORT'
@./$(VENV)/bin/isort --profile black ${PY_PATH} ${TEST_PATH}
@echo '<<< BLACK'
@./$(VENV)/bin/black ${PY_PATH} ${TEST_PATH}
@echo '<<< FLAKE8'
@./$(VENV)/bin/flake8 ${PY_PATH} ${TEST_PATH}
@echo '<<< MYPY'
@./$(VENV)/bin/mypy -p pytcp

test: venv
@echo '<<< TESTSLIDE'
@./$(VENV)/bin/testslide tests/*.py

bridge:
@brctl addbr br0

tap:
@ip tuntap add name tap7 mode tap
@ip link set dev tap7 up
@brctl addif br0 tap7
@echo 'Interface tap7 created and added to bridge br0'

.PHONY: all venv run clean lint bridge tap

Served by rngit 1.5.2 - Generated in 0.02s